package cool.zhang.bean;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.concurrent.CountDownLatch;

/**
 * Created by chemeng on 2017/4/1.
 */
public class Listen {
    private static Logger logger = LoggerFactory.getLogger(Listen.class);

    private CountDownLatch latch = new CountDownLatch(1);

    public void handleMsg(String message) {
        logger.info("receive msg :" + message);
        latch.countDown();
    }

    public CountDownLatch getLatch() {
        return latch;
    }
}
